I am new in Objective-C programming, can any one tell me how to Concatenate 2 or more NSString into 1 NSString with comma(,) sign.
For example I have 3 strings like this:
NSString *country1 = @"India";
NSString *country2 = @"China";
NSString *country3 = @"Japan";
I want to make a single string to store and in future I want to separate all these values by given sign.
Concatenate 2 or more NSString into 1 NSString in Objective-C
180607-Nov-2015
Updated on 08-Nov-2015
Tarun Kumar
08-Nov-2015You can use NSArray method 'stringWithFormat: ' to add two or more string variables into an array.
For example:
and also you can see I am concating two strings separated with comma(,) because in future, we can split this string by comma(,) as needed.